package com.yycwxt.modules.admin.dict;

import com.yycwxt.domain.Dict;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Api
@RestController
@RequestMapping("/dicts")
public class DictController {

    private DictService dictService;

    @Autowired
    public DictController(DictService dictService) {
        this.dictService = dictService;
    }

    @GetMapping("/flowfee")
    @ApiOperation("从对照表查询物流公司")
    public List<Dict> selectByflowfee(){
        Map<String, Object> map = new HashMap<>();
        map.put("name","物流公司");
        return dictService.listByMap(map);
    }

    @GetMapping("/operatefee")
    @ApiOperation("从对照表查询包材类型")
    public List<Dict> selectByoperatefee(){
        Map<String, Object> map = new HashMap<>();
        map.put("name","包装类型");
        return dictService.listByMap(map);
    }

    @GetMapping("/shopplatform")
    @ApiOperation("从对照表查询平台")
    public List<Dict> selectByshopplatform(){
        Map<String, Object> map = new HashMap<>();
        map.put("name","平台");
        return dictService.listByMap(map);
    }


    @GetMapping("/shoptype")
    @ApiOperation("从对照表查询店铺类型")
    public List<Dict> selectByshoptype(){
        Map<String, Object> map = new HashMap<>();
        map.put("name","店铺类型");
        return dictService.listByMap(map);
    }

}
